#ifndef __UPGRADE_H
#define __UPGRADE_H

/*
gd32l233CB mcu flash layout:
0x08000000 - 0x0801FFFF, total 128KB
designation  start address - end address, total size

bootloader 0x08000000 - 0x08002FFF,total 12KB
applicationA 0x08003000 - 0x08010FFF,total 56KB
applicationB 0x08011000 - 0x0801EFFF,total 56KB
user data 0x0801F000 - 0x0801FFFF,total 4KB

board id:0x0801E800
software version:0x0801E804
hardware version:0x0801E808
boot version:0x08002800

user data area is used to store upgrade flag and broken event flag
upgrade flag:       0x0801F000
broken event flag:  0x0801F004
*/

#define UPGRADE_FLAG_ADDR 0x0801F000

#define UPGRADE_AVAILABLE_FLAG 0x5A5A5A5A
#define UPGRADE_UNAVAILABLE_FLAG 0xFFFFFFFF

int ClearUpgradeFlag(void);
// int SimulateUpgrade(void);

#endif
